package cp4.resp;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class SetHeaderServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        resp.addHeader("author","zhangsan");
        resp.addHeader("author","lisi");

        resp.addHeader("show-time","2021-11-11 09:12:01");
        resp.setHeader("show-time","2021-11-11 09:12:01");

        PrintWriter writer = resp.getWriter();
        writer.println("set header ");
    }
}
